let vm = new Vue({
    el: '.page-content',
    data: {
        pageInfo: {},
        user: {},
        conditional:{
            username:''
        }
    },
    methods: {
        selectPage: function (pageNum = 1, pageSize = 5) {

            axios({
                url: `mapper/user/selectPage/${pageNum}/${pageSize}`,
                params:this.conditional
            }).then(response => {
                // this.result=response.data.obj;
                this.pageInfo = response.data.obj;
            }).catch(error => {
                console.log(error.message)
            })
        },
        toUpdate: function (user) {
            layer.obj = user;
            layer.open({
                type: 2,      //表示弹出一个iframe
                title: false,  //是否设置标题
                area: ['70%', '70%'],  //设置子窗口的宽高
                content: 'mapper/user/toUpdate', //iframe的url
                end: () => { //此处用于演示

                }
            })
        },
        Focuson:function () {

            layer.msg('是否关注', {
                time: 20000, //20s后自动关闭
                btn: ['是', '否'],
                yes: () => {
                    //删除标记（0：正常；1：删除；2：审核；）
                    axios({
                        url:`mapper/userFocus/insert`,
                        method: "post",
                        data: this.user
                    }).then(response => {

                        layer.msg("关注成功")
                        // this.selectPage();//刷新页面
                    }).catch(error => {
                        layer.msg(error.message)
                    });
                }
            });
        }
    },
    created: function () {
        this.selectPage();
    }

});